/**
    author: liaowenbing< sw@uninew.com / liaowb1234@126.com>
    time:   2013-02-21
    company: www.uninew.com
*/

typedef struct packet_list{
    struct list_head head;
    car_protocol_packet_t *packet;
}packet_list_t;

class ProtocolBase{
public:
    virtual int GetPacketMinLen();
    virtual int GetPacketMaxLen();
    virtual char* checkpacket(char* buf,int length,int* skip);
    virtual int ProcessPacketDatas(char *data,int length);

    int PutCarDatas(char *datas,int length);
    int GetCarDatas(char* buf,int length);
    int PutAppDatas(char *datas,int length);
    int GetAppDatas(char* buf,int length);
    int init(int length);
    int uninit();
    int start();
    int stop();

private:
    storage_buffer_t mHwInStorage;
    storage_buffer_t mHwOutStorage;
    int mBufState = 0;
    int mCarStorageCount = 0;
    int mAppStorageCount = 0;
};
